﻿#include "mainwindow.h"
#include "CloudMainWindow.h"
#include <QApplication>
#include <QThread>
#include "NetworkBusiness.h"
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;

    CloudMainWindow cloudMain;

    NetworkBusiness *network = new NetworkBusiness();
    QThread *thread = new QThread();
    network->moveToThread(thread);
    QObject::connect(&w,&MainWindow::signInReqSignal,network,&NetworkBusiness::signInReqHandle);

    QObject::connect(network,&NetworkBusiness::start,network,&NetworkBusiness::mainBusiness);
    QObject::connect(network, &NetworkBusiness::signInSucSiganl, &w, &MainWindow::signInSucHandle);

    QObject::connect(network,&NetworkBusiness::signInInitSignal,&cloudMain,&CloudMainWindow::signInInitHandle);
    thread->start();
    emit network->start();
    w.show();
    return a.exec();
}
